﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AddCheck
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] bytes = { 0x68, 0x03, 0x14, 0xCA, 0x07, 0x0D, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45,
                0x14, 0x01, 0xFF, 0xD9, 0x9E, 0x16 };
            
            Console.WriteLine("校验结果：" + add(bytes).ToString("X8"));

            Console.ReadKey();
        }

        static uint add(byte[] bytes) {
            uint crc = 0;
            for (int i = 0; i < bytes.Length - 2; i++) {
                crc += bytes[i];
            }
            return crc;
        }
    }
}
